class StockProduction {
  String? instockuserId;
  String? instockuserName;
  String? locationDestId;
  String? locationDestName;
  String? locationId;
  String? locationName;
  String? processId;
  String? processName;
  String? productId;
  String? productName;
  String? productUomId;
  String? qtyDone;
  String? productCode;
  String? spec;

  StockProduction({
    this.instockuserId,
    this.instockuserName,
    this.locationDestId,
    this.locationDestName,
    this.locationId,
    this.locationName,
    this.processId,
    this.processName,
    this.productId,
    this.productName,
    this.productUomId,
    this.qtyDone,
    this.productCode,
    this.spec,
  });

  factory StockProduction.fromMap(Map<String, dynamic> map) {
    return new StockProduction(
      instockuserId: map['instockuser_id'] != false
          ? map['instockuser_id'].toString() as String?
          : "",
      instockuserName: map['instockuser_id'] != false
          ? map['instockuser_id'][1].toString() as String?
          : "",
      locationDestId: map['location_dest_id'] != false
          ? map['location_dest_id'].toString() as String?
          : "",
      locationDestName: map['location_dest_id'] != false
          ? map['location_dest_id'][1].toString() as String?
          : "",
      locationId: map['location_id'] != false
          ? map['location_id'].toString() as String?
          : "",
      locationName: map['location_id'] != false
          ? map['location_id'][1].toString() as String?
          : "",
      processId: map['process_id'] != false
          ? map['process_id'].toString() as String?
          : "",
      processName: map['process_id'] != false
          ? map['process_id'][1].toString() as String?
          : "",
      productName: map['name'] != false
          ? map['name'].toString() as String?
          : "",
      productUomId: map['product_uom_id'] != false
          ? map['product_uom_id'].toString() as String?
          : "",
      qtyDone:
          map['qty_done'] != false ? map['qty_done'].toString() as String? : "",
      productCode:
          map['default_code'] != false ? map['default_code'].toString() as String? : "",
      spec:
          map['description'] != false ? map['description'].toString() as String? : "",
    );
  }
  factory StockProduction.materiaFromMap(Map<String, dynamic> map) {
    return new StockProduction(
      productUomId: map['uom_id'] != false
          ? map['uom_id'][1].toString() as String?
          : "",
      productName: map['default_name'] != false
          ? map['default_name'].toString() as String?
          : "",
      qtyDone:
        map['product_uom_qty'] != false ? map['product_uom_qty'].toString() as String? : "",
      productCode:
        map['default_code'] != false ? map['default_code'].toString() as String? : "",
      spec:
        map['description'] != false ? map['description'].toString() as String? : "",
    );
  }
}
